<template>
  <div>
    <ShopCarContent v-show="showContent" @hideContent="hideContent"></ShopCarContent>
    <footer>
      <div @click="toggleContent">
        <div class="logoWrap">
          <div class="shopCarLogoWrap">
            <i class="iconfont icon-shopcar"></i>
          </div>
        </div>
        <div class="sumPriceWrap">
          <div class="sumPrice">
            <span class="price">￥32</span>
            <span class="deliverPrice">另需配送费￥4元</span>
          </div>
        </div>
      </div>
      <div class="btnWrap">
        <div class="btn">￥20起送</div>
      </div>
    </footer>
  </div>
</template>

<script>
import ShopCarContent from './ShopCarContent.vue'
export default {
  name: '',
  data () {
    return {showContent: false}
  },
  methods: {
    toggleContent () {
      this.showContent = !this.showContent
    },
    hideContent () {
      this.showContent = false
    }
  },
  components: {
    ShopCarContent
  }
}
</script>

<style lang='scss' scoped>
  footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 96px;
    background: #141d27;
    z-index: 1;
    .logoWrap {
      position: absolute;
      left: 24px;
      top: 0;
      width: 112px;
      height: 112px;
      border-radius: 50%;
      margin-top: -22px;
      background: #141d27;
      color: rgba(255, 255, 255, .1);
    }
    .shopCarLogoWrap {
      position: absolute;
      left: 12px;
      top: 12px;
      height: 88px;
      width: 88px;
      line-height: 88px;
      text-align: center;
      border-radius: 50%;
      background: rgba(255, 255, 255, .2);
    }
    .icon-shopcar {
      font-size: 54px;/*px*/
      color: rgba(255, 255, 255, .4);
    }
    .sumPriceWrap {
      height: 100%;
      width: 100%;
      padding: 20px 0;
      line-height: 56px;
      padding-left: 162px;
      background: #141d27;
      .price {
        display: inline-block;
        margin-right: 14px;
        padding-right: 14px;
        font-size: 28px;/*px*/
        color: rgba(255, 255, 255, .4);
        border-right: 1px solid rgba(255, 255, 255, .1);
      }
      .deliverPrice {
        font-size: 28px;/*px*/
        color: rgba(255, 255, 255, .4);
      }
    }
    .btnWrap {
      position: absolute;
      right: 0;
      bottom: 0;
      top: 0;
      width: 200px;
      background: rgba(255, 255, 255, .4);
      .btn {
        padding: 0 16px;
        height: 100%;
        line-height: 96px;
        text-align: center;
        font-size: 24px;/*px*/
        font-weight: 700;
        color: rgba(255, 255, 255, .4);
      }
    }
  }
</style>
